home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / newsgrp / group01a.txt / 000040_icon-group-sender _Tue May 30 17:06:44 2000.msg < prev    next >
Internet Message Format  |  2002-01-03  |  2KB

  1. Return-Path: <icon-group-sender>
  2. Received: (from root@localhost)
  3.     by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id RAA28345
  4.     for icon-group-addresses; Tue, 30 May 2000 17:06:32 -0700 (MST)
  5. Message-Id: <200005310006.RAA28345@baskerville.CS.Arizona.EDU>
  6. Date: Tue, 30 May 2000 13:40:37 -0700
  7. From: Steve Wampler <swampler@noao.edu>
  8. X-Accept-Language: en
  9. To: icon-group <icon-group@optima.CS.Arizona.EDU>
  10. Subject: Re: CODE() and  @/2
  11. Errors-To: icon-group-errors@optima.CS.Arizona.EDU
  12. Status: RO
  13. Content-Length: 1611
  14.  
  15. "F.G. van DORP" wrote:
  16.  
  17. > I tried
  18. >        nextLabel := create "L" || (1 to 10) || ("foo" @ &source)
  19.  
  20. What did you intend the above to do?  I'm confused as to why you
  21. have the ("foo" @ &source) there.  If all you want are labels Lxfoo,
  22. where x is replaced by 1 to 10, you should use
  23.  
  24.         nextLabel := create "L" || (1 to 10) || "foo"
  25.  
  26. >        write(@nextlabel)
  27.  
  28. This must have been write(@nextLabel), right?
  29.  
  30. >         ....
  31. > and to my very surprise it did act as a regular RETURN (no
  32. > ASSEMBLER jargon necessary after all), writing
  33. >       L1foo
  34. >       ....
  35.  
  36. I don't see how the co-expression you've given would produce the above,
  37. are you sure that isn't the output from some other try?
  38.  
  39. In fact, I would expect to see "foo" printed by itself first, followed
  40. by a "string expected, offending value: &null" error if you activate
  41. nextLabel a second time without passing a value to it...
  42.  
  43. Try the following sample program:
  44.  
  45.     procedure main()
  46.         nextLabel := create "L" || (1 to 10) || "foo"
  47.  
  48.         write("Label 1 is ", @nextLabel)
  49.         write("Label 2 is ", @nextLabel)
  50.         write("Label 3 is ", @nextLabel)
  51.         write("Label 4 is ", @nextLabel)
  52.         write("Label 5 is ", @nextLabel)
  53.  
  54.         every write("Label ",6 to 10," is ",@nextLabel)
  55.     end
  56.  
  57. You should see the output:
  58.  
  59.     Label 1 is L1foo
  60.     Label 2 is L2foo
  61.     Label 3 is L3foo
  62.     Label 4 is L4foo
  63.     Label 5 is L5foo
  64.     Label 6 is L6foo
  65.     Label 7 is L7foo
  66.     Label 8 is L8foo
  67.     Label 9 is L9foo
  68.     Label 10 is L10foo
  69.  
  70.  
  71.  
  72.  
  73.  
  74.  
  75. --
  76. Steve Wampler-  SOLIS Project, National Solar Observatory
  77. swampler@noao.edu
  78.